varnish Basic


# varnish Basic

# 从epel仓库中安装

yum install epel-release -y
yum install varnish
1
2
复制代码

epel仓库中的varnish版本为4.0.5,截止目前,官方最新版本为6.4.0

# 从官方仓库中安装较新版本

5.2.0版本为例

curl -s https://packagecloud.io/install/repositories/varnishcache/varnish52/script.rpm.sh | sudo bash
yum install -y varnish
1
2
复制代码

# 编译安装

  1. Download the appropriate release tarball, which you can find on https://varnish-cache.org/releases/ .

  2. To build Varnish on a Red Hat or CentOS system, this command should install required packages (replace sudo yum install if needed):

sudo yum install \
    make \
    autoconf \
    automake \
    jemalloc-devel \
    libedit-devel \
    libtool \
    ncurses-devel \
    pcre-devel \
    pkgconfig \
    python-docutils \
    python-sphinx
1
2
3
4
5
6
7
8
9
10
11
12
复制代码

Optionally, to rebuild the svg files:

yum install graphviz
1
复制代码

Optionally, to pull from a repository:

yum install git
1
复制代码
  1. The configuration will need the dependencies above satisfied. Once that is taken care of:
cd varnish-cache
sh autogen.sh
sh configure
make
1
2
3
4
复制代码

The configure script takes some arguments, but more likely than not you can forget about that for now, almost everything in Varnish can be tweaked with run time parameters.

  1. Before you install, you may want to run the test suite, make a cup of tea while it runs, it usually takes a couple of minutes:
make check
1
复制代码
  1. And finally, the true test of a brave heart: sudo make install

Varnish will now be installed in /usr/local. The varnishd binary is in /usr/local/sbin/varnishd. To make sure that the necessary links and caches of the most recent shared libraries are found, run sudo ldconfig.

# 启动

使用systemctl start varnish即可,手动启动使用一下命令:

varnishd -a :6081 -T localhost:6082 -b localhost:8080
1
复制代码

# 参考链接

最近更新
01
生命短暂,犹如露珠消散,人们在奔波中寻求答案。
03-09
02
人生天地之间,若白驹过隙,忽然而已。
05-06
表情 | 预览
Code -1: Request has been terminated
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc. [N/A GET https://pum3vmup.api.lncld.net/1.1/classes/Comment]
Powered By Valine
v1.3.6